<template>
  <div class="con">
    <!-- 放置内容区 -->
    <div class="contbox6_10" v-if="true">
      <p class="titlelist6_10">
        账户管理<span style="color: #999;">&nbsp;&nbsp;/&nbsp;&nbsp;</span
        >账户管理
      </p>
      <div class="titlelist6" style="border-bottom:0px">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane
            label="全部账户"
            v-if="type == 2"
            name="first"
          ></el-tab-pane>
          <el-tab-pane
            label="我的账户"
            v-if="type != 2"
            name="second"
          ></el-tab-pane>
          <el-tab-pane
            label="代理账户"
            v-if="type != 2"
            name="third"
          ></el-tab-pane>
        </el-tabs>
      </div>
      <div class="content">
        <div v-if="activeName == 'second'" class="myAccount">
          <span class="lists">机构ID {{myList.officeUid}}</span>
          <span class="lists">机构名称 {{myList.officeName}}</span>
          <span class="lists">归属机构 {{myList.toOfficeName}}</span>
          <span class="lists">归属OEM {{myList.oemName}}</span>
          <span class="lists">账户金额 {{myList.totalAmt}}</span>
          <span class="lists">可用金额 {{myList.availAmt}}</span>
          <span class="lists">冻结金额 {{myList.freezeAmt}}</span>
          <span class="lists">累计提现金额 {{myList.drawAmt}}</span>
          <span class="lists">更新时间 {{myList.updateDate}}</span>
          <div class="tixian">
            <el-button type="primary" @click="Withdrawal">提现</el-button>
          </div>
        </div>
        <div class="sousuojg6_10" v-if="activeName != 'second'">
          <el-form ref="form" :model="form" label-width="100px">
            <el-form-item label="机构ID">
              <el-input
                placeholder="请输入机构ID"
                v-model="listQuery.officeUid"
              ></el-input>
            </el-form-item>
            <el-form-item label="机构类型">
              <el-select
                style="width:100%"
                v-model="listQuery.officeType"
                placeholder="请选择"
                class="filter-item"
              >
                <el-option label="全部" value></el-option>
                <el-option label="OEM" value="0" v-if="jurisdiction!=0"></el-option>
                <el-option label="普通代理" value="1"></el-option>
                <el-option label="渠道机构" value="3" v-if="jurisdiction!=0"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="机构名称">
              <el-input
                placeholder="请输入机构名称"
                v-model="listQuery.officeName"
              ></el-input>
            </el-form-item>
            <el-form-item label="归属OEM">
              <el-input
                placeholder="请输入归属OEM"
                v-model="listQuery.oemName"
              ></el-input>
            </el-form-item>
            <el-form-item label="账户状态">
              <el-select
                style="width:100%"
                v-model="listQuery.status"
                placeholder="请选择"
                class="filter-item"
              >
                <el-option
                  v-for="item in statusList"
                  :key="item.id"
                  :label="item.label"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="更新时间">
              <el-date-picker
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="开始日期"
                v-model="listQuery.startDate"
                style="width: 100%;"
              ></el-date-picker>
              <div class="times">-</div>
              <el-date-picker
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="结束日期"
                v-model="listQuery.endDate"
                style="width: 100%;"
              ></el-date-picker>
            </el-form-item>
          </el-form>
        </div>
        <div class="buttons" v-if="activeName != 'second'">
          <el-button
            v-if="isAuth('accountSearch')"
            style="margin-right:10px"
            type="primary"
            @click="handleSelectLists"
            >搜索
          </el-button>
          <el-button v-if="isAuth('accountReset')" @click="resetTheSearch"
            >重置</el-button
          >
          <el-button
            @click="exportFiles"
            class="butt"
            style="margin-left:40px"
            type="primary"
          >
            批量导出
          </el-button>
        </div>
        <el-table
          v-if="activeName != 'second'"
          :data="list"
          ref="multipleTable"
          :header-cell-style="{ background: '#F9FAFC', color: '#222' }"
          stripe
          border
          :row-style="{ height: '0px' }"
          :cell-style="{ padding: '0px' }"
          style="margin-top: 24px !important;">
          <!-- <el-table-column type="selection" width="55"></el-table-column> -->
          
          <el-table-column
            show-overflow-tooltip
            min-width="120px"
            label="归属OEM"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.oemName }}</span>
            </template>
          </el-table-column>
          <el-table-column
            show-overflow-tooltip
            min-width="180px"
            label="机构ID"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.officeUid }}</span>
            </template>
          </el-table-column>
          <el-table-column
            show-overflow-tooltip
            min-width="120px"
            label="机构名称"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.officeName }}</span>
            </template>
          </el-table-column>
          <el-table-column
            show-overflow-tooltip
            min-width="120px"
            label="机构类型"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.officeType == 0 ? "OEM" :scope.row.officeType == 1 ?  "普通代理":"渠道机构" }}</span>
            </template>
          </el-table-column>
          
          <el-table-column
            show-overflow-tooltip
            min-width="120px"
            label="账户金额(元)"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.totalAmt }}</span>
            </template>
          </el-table-column>
          <el-table-column
            show-overflow-tooltip
            min-width="120px"
            label="可用金额(元)"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.availAmt }}</span>
            </template>
          </el-table-column>
          <el-table-column
            show-overflow-tooltip
            min-width="120px"
            label="冻结金额(元)"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.freezeAmt }}</span>
            </template>
          </el-table-column>
          <el-table-column
            show-overflow-tooltip
            min-width="130px"
            label="累计提现金额(元)"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.drawAmt }}</span>
            </template>
          </el-table-column>
          <!-- <el-table-column
            show-overflow-tooltip
            min-width="80px"
            label="账户积分"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.points }}</span>
            </template>
          </el-table-column>
          <el-table-column
            show-overflow-tooltip
            min-width="80px"
            label="可用积分"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.points }}</span>
            </template>
          </el-table-column> -->
          <el-table-column
            show-overflow-tooltip
            min-width="80px"
            label="账户状态"
          >
            <template slot-scope="scope">
              <span>{{
                scope.row.status == 1
                  ? "停用"
                  : scope.row.status == 2
                  ? "冻结"
                  : "启用"
              }}</span>
            </template>
          </el-table-column>
          <el-table-column min-width="160px" label="更新时间">
            <template slot-scope="scope">
              <span>{{ scope.row.updateDate }}</span>
            </template>
          </el-table-column>
          <el-table-column :span="8" width="200" label="操作">
            <template slot-scope="scope">
              <el-button
                size="text"
                type="text"
                v-if="isAuth('accountError')"
                @click="operation(scope.row, 1)"
                >差错</el-button
              >
              <el-button
                size="text"
                type="text"
                v-if="isAuth('accountFrozen')"
                @click="operation(scope.row, 2)"
                >冻结</el-button
              >
              <el-button
                size="text"
                type="text"
                v-if="scope.row.status == 0 && isAuth('accountClose')"
                @click="closeStatus(scope.row)"
              >
                停用
              </el-button>
              <el-button
                size="text"
                type="primary"
                v-if="scope.row.status == 1 && isAuth('accountClose')"
                @click="closeStatus(scope.row)"
              >
                启用
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <div style="font-size: 16px;margin-top: 30px">
          <div v-if="activeName != 'second'" class="pagination-container">
            <el-pagination
              background
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page.sync="listQuery.page"
              :page-sizes="[20, 50, 100]"
              :page-size="listQuery.number"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total"
            ></el-pagination>
          </div>
        </div>
      </div>
    </div>
    <el-dialog
      :title="dialogFormTitle"
      :visible.sync="dialogFormWindows"
      width="500px"
      :close-on-click-modal="false">
      <el-form :model="form" ref="form" label-width="80px">
        <el-row style="margin-top: -30px;">
          <p class="">账户信息</p>
          <div
            style="width: 100%; float: left; border-bottom: 1px solid rgb(238, 238, 238); margin-bottom: 30px;"
          ></div>
          <el-Col>
            <el-form-item label="机构名称" prop="channelName">
              <el-input
                style="width:350px !important"
                v-model="form.officeName"
                disabled
                class="officeName"
                placeholder="暂无机构名称"
              ></el-input>
            </el-form-item>
          </el-Col>
          <el-Col>
            <el-form-item label="账户总额" prop="channelType">
              <el-input
                style="width:350px !important"
                class="officeName"
                v-model="form.totalAmt"
                disabled
                placeholder="暂无账户总额"
              >
                元
              </el-input>
            </el-form-item>
          </el-Col>
        </el-row>
        <el-row>
          <el-Col>
            <el-form-item label="可用余额" prop="channelType">
              <el-input
                style="width:350px !important"
                class="officeName"
                v-model="form.availAmt"
                disabled
                placeholder="暂无可用余额"
                >元</el-input
              >
            </el-form-item>
          </el-Col>
          <el-Col>
            <el-form-item
              label="已冻结金额"
              prop="channelType"
              style="width:350px !important"
              class="officeName"
              v-if="dialogFormTitle == '冻结处理'"
            >
              <el-input
                v-model="form.freezeAmt"
                disabled
                style="width:350px !important"
                class="officeName"
                placeholder="暂无已冻结金额"
                >元
              </el-input>
            </el-form-item>
          </el-Col>
        </el-row>
        <!-- <el-row>
          <el-Col>
            <el-form-item label="积分总额" prop="channelType">
              <el-input
                v-model="form.points"
                disabled
                style="width:350px !important"
                class="officeName"
                placeholder="暂无可用余额"
                >元
              </el-input>
            </el-form-item>
          </el-Col>
          <el-Col>
            <el-form-item
              label="可用积分"
              prop="channelType"
              style="width:350px !important"
              class="officeName"
            >
              <el-input
                v-model="form.points"
                disabled
                placeholder="暂无已冻结金额"
                >元
              </el-input>
            </el-form-item>
          </el-Col>
        </el-row> -->
        <p class="" style="margin-top: 10px">
          设置冻结金额
        </p>
        <div
          style="width: 100%; float: left; border-bottom: 1px solid rgb(238, 238, 238); margin-bottom: 30px;"
        ></div>
        <el-row>
          <el-Col>
            <el-form-item
              style="width:350px !important"
              class="officeName"
              :label="
                dialogFormTitle == '设置冻结处理' ? '操作类别' : '差错类别'
              "
              prop="channelName"
            >
              <el-select
                v-model="form.type"
                placeholder="请选择类别"
                class="filter-item"
              >
                <el-option
                  v-for="item in moneyType"
                  :key="item.id"
                  :label="item.label"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-Col>
          <el-Col>
            <el-form-item
              style="width:350px !important"
              class="officeName"
              :label="
                dialogFormTitle == '设置冻结处理' ? '操作金额' : '差错金额'
              "
              prop="channelType"
            >
              <el-input
                v-model="form.amt"
                @input="
                  value => {
                    form.amt = value.replace(
                      /^\D*(\d*(?:\.\d{0,2})?).*$/g,
                      '$1'
                    );
                  }
                "
                maxlength="10"
                placeholder="请输入金额"
                >元
              </el-input>
            </el-form-item>
          </el-Col>
        </el-row>
        <el-row>
          <el-Col :span="24">
            <el-form-item label="备注说明" prop="channelType">
              <el-input
                type="textarea"
                style="width:350px"
                v-model="form.remarks"
                placeholder="请输入备注说明"
              ></el-input>
            </el-form-item>
          </el-Col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormWindows = false">取 消</el-button>
        <el-button type="primary" @click="create('form')">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog :close-on-click-modal='false' title="提现" width="900px" :visible.sync="dialogFormWindows1">
      <el-row>
        <el-form :model="incomeForm" ref="incomeForm" label-width="100px">
          <el-col>
          <el-form-item label="提现金额">
            <el-input @input="value=>{WithdrawalList.cashOutAmount=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}" v-model="WithdrawalList.cashOutAmount"></el-input>
          </el-form-item></el-col>
          <el-col><el-form-item>
           可提现金额 {{WithdrawalList.availDrawAmt}}
          </el-form-item></el-col>
          <el-col>
            <div style="margin-left:32px;min-height:42px;line-height:42px">可提现金额({{WithdrawalList.availDrawAmt}}) = 我的账户金额({{WithdrawalList.totalAmt}}）- 冻结金额（{{WithdrawalList.freezeAmt}}）- 所有普通代理账户金额({{WithdrawalList.agentAmt}})</div>
          </el-col>
          <el-col>
            <div style="margin-left:32px;height:42px;line-height:42px">账户名称：{{WithdrawalList.accountName}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 结算账号：{{WithdrawalList.accountNo}}</div>
          </el-col>
          <el-col v-if="WithdrawalList.cardType=='1'">
            <el-form-item label="有无发票" prop="resource">
              <el-radio-group v-model="WithdrawalList.billFlag">
                <el-radio label="1">有</el-radio>
                <el-radio label="0">无</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col>
            <div style="margin-left:32px;height:42px;line-height:42px;font-size: 18px;">温馨提示</div>
          </el-col>
          <el-col>
            <div style="margin-left:32px;min-height:42px;line-height:42px">1. 提现手续费：单笔手续费{{WithdrawalList.drawFee}}元+{{WithdrawalList.taxRate}}%；，单笔无票税率{{WithdrawalList.drawRate}}%</div>
          </el-col>
          <el-col>
            <div style="margin-left:32px;min-height:42px;line-height:42px">2. 提现规则：单笔最低提现金额{{WithdrawalList.singleMinAmt}}元，单笔最高提现金额{{WithdrawalList.singleMaxAmt}}元，单日最大提现次数{{WithdrawalList.dayMaxCnt}}次，单日封顶提现金额{{WithdrawalList.dayAmt}}元；</div>
          </el-col>
          <el-col>
            <div style="margin-left:32px;min-height:42px;line-height:42px">3. 提现金额预计到账时间1-5个工作日</div>
          </el-col>
          <el-col v-if="WithdrawalList.cardType=='1'">
            <div style="margin-left:32px;height:42px;line-height:42px">4. 如需提供发票，请必须提供6个点增值税专用发票；</div>
          </el-col>
          <el-col v-if="WithdrawalList.cardType=='1'">
            <div style="margin-left:32px;height:42px;line-height:42px">5. 邮寄发票地址: 北京市海淀区西直门北大街甲43号1号楼12层1-25-1201至1-25-1210。</div>
          </el-col>
        </el-form>
      </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormWindows1 = false">取 消</el-button>
        <el-button type="primary" @click="sure">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisibleCard"
      width="400px"
      :before-close="handleClose">
      <div>
        请先绑定结算账户！
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisibleCard=false">取 消</el-button>
        <el-button type="primary" @click="determine">确 定</el-button>
      </span>
    </el-dialog>
    <Tree :showType="showType" @func="transmit" />
  </div>
</template>

<script>
import Tree from "../tree/index";
import https from "../../plugins/https.js";
import { CompareDate } from "../../assets/js/commion";
// 批量导出
import { exportFile } from "../../plugins/expord";
export default {
  name: "shareTheTemplate",
  data() {
    return {
      jurisdiction:"",
      dialogVisibleCard:false,
      incomeForm:{},
      activeName:localStorage.getItem("jurisdiction") == "2" ? "first" : "second",
      list: [],
      total: null,
      listLoading: true,
      checkedAll: false,
      showType: false,
      officeName: "",
      type: localStorage.getItem("jurisdiction"),
      listQuery: {
        oemUid:
          localStorage.getItem("jurisdiction") != 2
            ? localStorage.getItem("uid")
            : undefined, //OEMid
        officeUid: undefined, ////	机构ID	String	N
        officeName: undefined, //	机构名称	String	N
        officeType: "", //	机构类型	String	N	0:OEM代理 1:普通代理
        accountType: undefined, //	账户类型	String	N	0支付宝 1 对公账户
        accountNo: undefined, //	账户号码	String	N
        status: "", //	账户状态	String	N	0:正常 1:停用 2:冻结
        startDate: "", //	开始时间	String	N
        endDate: "", //	结束时间	String	N
        page: 1, //第几页
        number: 20 //每页几条
      },
      form: {
        accUid: undefined,
        type: undefined,
        amt: undefined,
        remarks: undefined,
        officeName: undefined,
        totalAmt: undefined,
        freezeAmt: undefined,
        availAmt: undefined
      },
      moneyType: [
        { label: "解冻", id: 1 },
        { label: "冻结", id: 2 },
        { label: "差错账增加", id: 3 },
        {
          label: "差错账减少",
          id: 4
        }
      ],

      dialogFormTitle: "",
      accountType: [
        { label: "支付宝", id: "0" },
        { label: "对公账户", id: "1" }
      ],
      statusList: [
        { label: "全部", id: "" },
        { label: "启用", id: "0" },
        { label: "停用", id: "1" }
      ],
      officeType: [
        { label: "全部", id: "" },
        { label: "OEM", id: "0" },
        { label: "普通代理", id: "1" },
        { label: "渠道机构", id: "3" }
      ],
      selectTime: [], //时间数组
      dialogFormWindows: false, //弹窗
      dialogFormWindows1:false,
      multipleSelection: [], //选中的数组
      sign: localStorage.getItem("jurisdiction"), //true, //最高权限看到的true
      myList:{},
      WithdrawalList:{}
    };
  },
  components: {
    Tree
  },
  created() {
    this.jurisdiction = localStorage.getItem("jurisdiction")
  },
  mounted() {
    let that = this;
    if(localStorage.getItem('yactiveName')){
       this.activeName = localStorage.getItem("yactiveName");
        if(this.activeName=="second"){
        that.myAccount()
      }else{
        that.handleSelectList();
      }
    }else{
      if(this.activeName=="second"){
        that.myAccount()
      }else{
        that.handleSelectList();
      }
    }
    
  },

  watch: {
    selectTime(val, upVal) {
      let that = this;
      if (!this.selectTime) {
        that.listQuery.startDate = "";
        that.listQuery.endDate = "";
      }
    }
  },
  methods: {
    // 提现
    Withdrawal(){
      console.log(localStorage.getItem('authenticationStatus'))
      if(localStorage.getItem('authenticationStatus')=='0'){
        https.getDrawInfo().then(res=>{
          console.log(res)
          if(res.data.code=="0000"){
            this.WithdrawalList=res.data.data
            this.dialogFormWindows1=true
          }else{
            layer.open({
              content: res.data.msg,
              skin: "msg",
              time: 2 //1秒后自动关闭
            });
          }
        })
      }else{
        this.dialogVisibleCard=true
      }
      
    },
    
    myAccount(){
      https.getAccountInfo().then(res=>{
        if(res.data.code=="0000"){
          this.myList=res.data.data
        }else{
          layer.open({
            content: res.data.msg,
            skin: "msg",
            time: 2 //1秒后自动关闭
          });
        }
      }).catch(err=>{})
    },
    sure(){
      console.log(this.WithdrawalList)
      if(this.WithdrawalList.cardType=="1" && this.WithdrawalList.billFlag==""){
        layer.open({
          content: '请选择有无发票',
          skin: "msg",
          time: 2 //1秒后自动关闭
        });
        return
      }
      if(this.WithdrawalList.cashOutAmount){
       if(Number(this.WithdrawalList.cashOutAmount)>Number(this.WithdrawalList.availDrawAmt)){
        layer.open({
          content: '提现金额不能大于可提现金额',
          skin: "msg",
          time: 2 //1秒后自动关闭
        });
      }else{
        this.WithdrawalList.officeUid=localStorage.getItem('uid')
        https.subWithdraw(this.WithdrawalList).then(res=>{
          if(res.data.code=="0000"){
            this.myAccount()
            this.dialogFormWindows1=false
          }else{
            layer.open({
              content: res.data.msg,
              skin: "msg",
              time: 2 //1秒后自动关闭
            });
          }
        })
      }
      }else{
        layer.open({
              content: "提现金额不能为空",
              skin: "msg",
              time: 2 //1秒后自动关闭
            });
      }
      
    },
    // tab切换
    handleClick(tab) {
      localStorage.setItem("yactiveName", this.activeName);
      
      if(this.activeName=="second"){
        this.myAccount()
      }else{
        this.resetTheSearch()
        this.handleSelectList();
      }
      console.log(tab);
    },
    //这里开始
    transmit(data) {
      // console.log(data.uid)
      //归属机构的uid
      this.listQuery.officeUid = data.uid;
      this.officeName = data.name;
      // console.log(this.form.officeUid)
      // //归属机构名字
      // this.mechanism = data.name
      // this.
    },
    //设置取消的
    determine() {
      // alert("执行")
       this.dialogVisibleCard=false
      this.$router.push({
        name:"oemBasic"
      })
    },

    selectInstitution() {
      this.showType = true;
    },
    //这里结束

    /**
     * @Author： Zhu Liang Fu
     * @Date：2020/7/15
     * @annotation: 全选
     **/
    selAll() {
      if (this.checkedAll) {
        this.list.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 16:41
     * @annotation： 界面集合获取数据
     **/
    handleSelectList() {
      let that = this;
      that.listLoading = true;
      https.accountList(that.listQuery).then(res => {
        if (res.data.code == "0000") {
          that.list = res.data.data;
          that.total = res.data.total;
          that.listLoading = false;
        } else {
          that.listLoading = false;
          layer.open({
            content: res.data.msg,
            skin: "msg",
            time: 2 //1秒后自动关闭
          });
        }
      });
    },
    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 17:57
     * @annotation： 分页
     **/
    handleSizeChange(val) {
      let that = this;
      that.listQuery.number = val;
      that.listQuery.page = 1;
      that.handleSelectList();
    },

    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 17:57
     * @annotation： 分页
     **/
    handleCurrentChange(val) {
      let that = this;
      that.listQuery.page = val;
      that.handleSelectList();
    },
    handleSelectLists() {
      this.listQuery.page = 1;
       let bool = CompareDate(this.listQuery.startDate, this.listQuery.endDate);
      if (this.listQuery.startDate != "" && this.listQuery.endDate != "") {
        if (bool) this.handleSelectList();
        else this.warrys();
      } else {
        // debugger
        this.handleSelectList();
      }

    },
     // 校验时间的一个方法
    warrys() {
      layer.open({
        content: "开始时间不能大于结束时间",
        skin: "msg",
        time: 2 //1秒后自动关闭
      });
    },
    /**
     * @author: Zhu Liangfu
     * @Description: 操作
     * @date:2020/6/15   20:07
     */
    operation(row, status) {
      let that = this;
      that.form = {
        accUid: undefined,
        type: undefined,
        amt: undefined,
        remarks: undefined,
        officeName: undefined,
        totalAmt: undefined,
        freezeAmt: undefined,
        availAmt: undefined,
        points: undefined
      };
      // console.log(5555555555, status, row)
      if (status == 1) {
        that.form.accUid = row.id;
        that.form.officeName = row.officeName;
        that.form.totalAmt = row.totalAmt;
        that.form.availAmt = row.availAmt;
        that.form.points = row.points;
        that.dialogFormTitle = "设置差错金额";
        that.moneyType = [
          { label: "账户差错账增加", id: 3 },
          { label: "账户差错账减少", id: 4 },
          // { label: "积分差错账增加", id: 7 },
          // { label: "积分差错账减少", id: 8 }
        ];
        that.dialogFormWindows = true;
      } else {
        that.moneyType = [
          { label: "账户解冻", id: 1 },
          { label: "账户冻结", id: 2 },
          // { label: "积分解冻", id: 5 },
          // { label: "积分冻结", id: 6 }
        ];
        that.form.accUid = row.id;
        that.form.officeName = row.officeName;
        that.form.totalAmt = row.totalAmt;
        that.form.availAmt = row.availAmt;
        that.form.freezeAmt = row.freezeAmt;
        that.form.points = row.points;
        that.dialogFormTitle = "设置冻结处理";
        that.dialogFormWindows = true;
      }
    },

    /**
     * @author: Zhu Liangfu
     * @Description: 确认接口 差错
     * @date:2020/6/15   20:46
     */
    create() {
      let that = this;
      https.updateAccountInfo(that.form).then(res => {
        if (res.data.code == "0000") {
          that.handleSelectList();
          that.dialogFormWindows = false;
          layer.open({
            content: res.data.msg,
            skin: "msg",
            time: 2 //1秒后自动关闭
          });
        } else {
          layer.open({
            content: res.data.msg,
            skin: "msg",
            time: 2 //1秒后自动关闭
          });
        }
      });
    },

    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/23 20:49
     * @annotation：停用启用
     **/
    closeStatus(row) {
      let that = this;
      https
        .accountChange({ uid: row.id, status: row.status == 1 ? "0" : "1" })
        .then(res => {
          if (res.data.code == "0000") {
            that.handleSelectList();
            that.dialogFormWindows = false;
            layer.open({
              content: res.data.msg,
              skin: "msg",
              time: 2 //1秒后自动关闭
            });
          } else {
            layer.open({
              content: res.data.msg,
              skin: "msg",
              time: 2 //1秒后自动关闭
            });
          }
        });
    },

    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 16:41
     * @annotation：  时间格式化
     **/
    timeData(e) {
      let that = this;
      if (e) {
        that.listQuery.startDate = e[0];
        that.listQuery.endDate = e[1];
      } else {
        that.listQuery.startDate = undefined;
        that.listQuery.endDate = undefined;
      }
    },
    handleClose(done) {
      done();
    },
    /**
     * @author: Zhu Liangfu
     * @Description: 导出模板
     * @date:2020/6/11   20:44
     */
    exportFiles() {
      let that = this;
      exportFile(
        "/api/account/accountInfo/excel/export",
        that.listQuery,
        "账户管理"
      );
    },
    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 17:50
     * @annotation： 重置查询条件
     **/
    resetTheSearch() {
      this.officeName = "";
      let that = this;
      that.listQuery = {
        oemUid:
          localStorage.getItem("jurisdiction") != 2
            ? localStorage.getItem("uid")
            : undefined, //OEMid
        officeUid: undefined, ////	机构ID	String	N
        officeName: undefined, //	机构名称	String	N
        officeType: "", //	机构类型	String	N	0:OEM代理 1:普通代理
        accountType: undefined, //	账户类型	String	N	0支付宝 1 对公账户
        accountNo: undefined, //	账户号码	String	N
        status: "", //	账户状态	String	N	0:正常 1:停用 2:冻结
        startDate: "", //	开始时间	String	N
        endDate: "", //	结束时间	String	N
        page: 1, //第几页
        number: 20 //每页几条
      };
      that.selectTime = [];
      that.handleSelectList();
    }
  },
  beforeDestroy(){
    localStorage.removeItem('yactiveName')
  }
};
</script>

<style scoped>
.con {
  position: relative;
}
/* 单独样式 */
.contbox6_10 {
  width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  float: left;
}
.sousuojg6_10 {
  padding-top: 0px;
}
.fileList {
  display: inline-block;
  border-style: solid dotted dashed double;
  padding: 8px 8px 8px 8px;
  text-align: center;
}
.times {
  width: 20px;
  display: inline-block;
  text-align: center;
}
.el-textarea {
  width: 200px;
}
.buttons > .el-button {
  width: 100px;
  padding: 7px;
  height: 32px;
}
/deep/ .officeName .el-input__inner {
  width: 350px !important;
}
/deep/ .officeName .el-input {
  width: 350px;
}
.tabs {
  width: 100%;
  height: 60px;
  margin-left: 20px;
}
.myAccount {
  width: calc(100% - 40px);
  margin: 0 20px;
  background: #f9fafc;
  float: left;
  padding: 20px;
  position: absolute;
  /* min-height: 20px; */
}
.lists {
  width: 450px;
  height: 32px;
  float: left;
}
.tixian {
  float: left;
  width: 100%;
}
.tixian /deep/ .el-button {
  margin-left: 40%;
  height: 32px;
  padding: 9px 20px;
  width: 200px;
}
.content{
  margin-top: 90px;
  height: calc(100vh - 100px - 80px);
}
</style>